package {
  import flash.display.Sprite;
  import flash.filters.BlurFilter;
  
  public class FoodPile extends Sprite {
    public var numFoodLeft:int;
    public var size:int = 0;
    public function FoodPile(_x:int, _y:int, numFood:int) {
      numFoodLeft = numFood;
      graphics.beginFill(0xFFAC12);
      if (numFoodLeft == 1) size = Food.FOOD_SIZE;
      if (numFoodLeft > 1 && numFoodLeft <= 5) size = 12.5;
      if (numFoodLeft > 5 && numFoodLeft <= 10) size = 20;
      if (numFoodLeft > 10) size = 30;
      graphics.drawRect(-size / 2.0, -size / 2.0, size, size);
      x = _x;
      y = _y;
      graphics.endFill();
      filters = [ Main.blur ];
    }
  }
}